package com.byapp.fast.common.converter;

import com.byapp.fast.modules.contract.dto.BetOddsDTO;
import com.byapp.fast.modules.contract.dto.ChangeBetOddsDTO;
import com.byapp.fast.modules.match.entity.MatchOddsEntity;

import java.util.List;

public class ChangeBetOddsDTOConverter {

    public static ChangeBetOddsDTO create(MatchOddsEntity matchOddsEntity) {
        ChangeBetOddsDTO changeBetOddsDTO = new ChangeBetOddsDTO();

        // 获取玩法赔率详情
        List<BetOddsDTO> betOddsDTOS = BetOddsDTOConverter.mapToTarget(matchOddsEntity);

        String id = String.valueOf(matchOddsEntity.getId());
        String matchId = matchOddsEntity.getMatchId();
        String betStatus = matchOddsEntity.getBetStatus();

        changeBetOddsDTO.setPlayId(id)
                .setLid(matchId)
                .setBetOdds(betOddsDTOS)
                .setStatus(betStatus);

        return changeBetOddsDTO;
    }
}
